package com.tianqi.modules.tqs.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

import java.util.HashMap;
import java.util.Map;

/**
 * 核心业务数据类型
 *
 * @author zhangzedi
 * @date 2023/8/5 23:42
 **/
public enum CoreTypeEnum {


	WUXING_LIUQIN("WUXING_LIUQIN", "五行对应六亲"),

	TIANGAN_TIANGAN_LIUQIN("TIANGAN_TIANGAN_LIUQIN", "天干对应天干六亲"),

	TIANGAN_TIANGAN_SHISHEN("TIANGAN_TIANGAN_SHISHEN", "天干对应天干十神"),

	TIANGAN_DIZHI_LIUQIN("TIANGAN_DIZHI_LIUQIN", "天干对应地支六亲"),

	TIANGAN_DIZHI_SHISHEN("TIANGAN_DIZHI_SHISHEN", "天干对应地支十神关系"),

	DIZHI_DIZHI_LIUQIN("DIZHI_DIZHI_LIUQIN", "地支对应地支六亲"),

	DIZHI_DIZHI_SHISHEN("DIZHI_DIZHI_SHISHEN", "地支对应地支十神"),

	TIANGAN_SHIER_CHANGSHENG("TIANGAN_SHIER_CHANGSHENG", "天干十二长生"),

	DIZHI_SHIER_CHANGSHENG("DIZHI_SHIER_CHANGSHENG", "地支十二长生"),

	DIZHI_LIUCHONG("DIZHI_LIUCHONG", "地支六冲"),

	DIZHI_LIUHE("DIZHI_LIUHE", "地支六合"),

	DIZHI_XIANGXING("DIZHI_XIANGXING", "地支相刑"),

	DIZHI_XIANGHAI("DIZHI_XIANGHAI", "地支相害"),

	TIANGAN_WUHE("TIANGAN_WUHE", "天干五合"),

	TIANGAN_XIANGCHONG("TIANGAN_WUHE", "天干相冲"),

	ERSHIBA_XINGXIU("ERSHIBA_XINGXIU", "28星宿查法"),

	MINGGONG("MINGGONG", "命宫查法"),

	SHENGONG("SHENGONG", "身宫查法"),

	;

	/**
	 * 类型
	 */
	@EnumValue
	private String type;

	/**
	 * 名称
	 */
	private String name;

	private static Map<String, CoreTypeEnum> coreTypeEnumMap = new HashMap<>();

	static {
		for (CoreTypeEnum value : CoreTypeEnum.values()) {
			coreTypeEnumMap.put(value.getName(), value);
		}
	}

	public String getType() {
		return type;
	}

	public String getName() {
		return name;
	}

	CoreTypeEnum(String type, String name) {
		this.type = type;
		this.name = name;
	}

	public static CoreTypeEnum getByName(String name) {
		return coreTypeEnumMap.get(name);
	}
}
